﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/RightFrame.Master"
    CodeBehind="ManageMessage.aspx.cs" Inherits="MyOA.UI.Message.MessageManage.MessageManage" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphTitle" runat="server">
    当前位置：消息管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContnent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <script language="javascript" type="text/javascript" src="../../My97DatePicker/WdatePicker.js"></script>

            <script type="text/javascript">
                var Alert=ymPrompt.alert;
                var Error = ymPrompt.errorInfo;
                function href() {
                    document.location.href = "ManageMessage.aspx";
                }
            </script>
             <div class="body_title">消&nbsp;&nbsp;息&nbsp;&nbsp;管&nbsp;&nbsp;理</div>
            
            <contenttemplate>
            <div style="text-align: center; position:relative;top:20px;">
                <div style="font-size: 12px; width: 90%; text-align: left">
                    <asp:Button ID="btnNewMessage" OnClick="btnNewMessage_Click" runat="server" CssClass="buttonCss"
                        Text="新消息"></asp:Button>
                    <asp:Label ID="lblNotRead" runat="server" Text=""></asp:Label>
                    <br />
                    <br />
                    <asp:Button ID="btnReceive" OnClick="btnReceive_Click" runat="server" CssClass="buttonCss"
                        Width="100%" Text="收件箱"></asp:Button>
                    <div style="width: 100%; background-color: transparent" id="div_Receive" runat="server">
                        <asp:GridView ID="gvReceive" runat="server" Width="100%" 
                            AutoGenerateColumns="False" onrowcommand="gvReceive_RowCommand" 
                            onrowdatabound="gvReceive_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="MessageId" SortExpression="MessageId" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("MessageId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息主题" SortExpression="MsgTitle">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTitle" runat="server" Text='<%# CutString(10,Eval("MsgTitle")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息内容" SortExpression="MsgContent">
                                    <ItemTemplate>
                                        <asp:Label ID="lblContent" runat="server" Text='<%# CutString(20,Eval("MsgContent")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="RecordTime" HeaderText="发送时间" SortExpression="RecordTime" />
                                <asp:TemplateField HeaderText="发件人" SortExpression="FromUser">
                                    <ItemTemplate>
                                        <asp:Label ID="lblFromUser" runat="server" Text='<%# Eval("FromUser.UserName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="详细">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnReveiceEdit" CommandName= "ReveiceEdit" runat="server"
                                            ImageUrl="~/images/edit.gif" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="删除">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnReveiceDel" runat="server" ImageUrl="~/images/delete.gif"
                                          CommandName="ReveiceDel" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <div style="text-align:center">
                     <webdiyer:aspnetpager ID="anpReceive" runat="server" CssClass="paginator" PageSize="5"
                     ShowNavigationToolTip="True" PageIndexBoxType="DropDownList" 
                    PagingButtonSpacing="10px" ShowPageIndexBox="Always"
                            onpagechanged="anpReceive_PageChanged">
                </webdiyer:aspnetpager>
                </div>
                        <div style="margin-top: 5px">
                            <asp:Button ID="btnShowAll" OnClick="btnShowAll_Click" runat="server" CssClass="buttonCss"
                                Text="显示全部"></asp:Button>&nbsp;&nbsp;
                            <asp:Button ID="btnNotRead" OnClick="btnNotRead_Click" runat="server" CssClass="buttonCss"
                                Text="未读"></asp:Button>&nbsp;&nbsp;
                            <asp:Button ID="btnRead" OnClick="btnRead_Click" runat="server" CssClass="buttonCss"
                                Text="已读"></asp:Button>
                        </div>
                    </div>
                    <br />
                    <asp:Button ID="btnSend" OnClick="btnSend_Click" runat="server" CssClass="buttonCss"
                        Width="100%" Text="已发送"></asp:Button>
                    <div style="width: 100%; background-color: transparent" id="div_Send" runat="server"
                        visible="false">
                        <asp:GridView ID="gvSend" runat="server" Width="100%" AutoGenerateColumns="False"
                            OnRowDataBound="gvSend_RowDataBound" DataKeyNames="MessageId" 
                            onrowcommand="gvSend_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="MessageId" SortExpression="MessageId" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("MessageId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息主题" SortExpression="MsgTitle">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTitle" runat="server" Text='<%# CutString(10,Eval("MsgTitle")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息内容" SortExpression="MsgContent">
                                    <ItemTemplate>
                                        <asp:Label ID="lblContent" runat="server" Text='<%# CutString(20,Eval("MsgContent")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="RecordTime" HeaderText="发送时间" SortExpression="RecordTime" />
                                <asp:TemplateField HeaderText="发件人" SortExpression="FromUser">
                                    <ItemTemplate>
                                        <asp:Label ID="lblFromUser" runat="server" Text='<%# Eval("FromUser.UserName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="详细">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnSendEdit" CommandName="sendEdit" runat="server"
                                            ImageUrl="~/images/edit.gif" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="删除">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnSendDel" runat="server" ImageUrl="~/images/delete.gif"
                                            CommandName="sendDel" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                           <div style="text-align:center">
                     <webdiyer:aspnetpager ID="anpSend" runat="server" CssClass="paginator" PageSize="5"
                     ShowNavigationToolTip="True" PageIndexBoxType="DropDownList" 
                    PagingButtonSpacing="10px" ShowPageIndexBox="Always" onpagechanged="anpSend_PageChanged">
                </webdiyer:aspnetpager>
                </div>
                    </div>
                    <br />
                    <asp:Button ID="btnDelete" OnClick="btnDelete_Click" runat="server" CssClass="buttonCss"
                        Width="100%" Text="回收站"></asp:Button>
                    <div style="width: 100%; background-color: transparent" id="div_Recycle" runat="server"
                        visible="false">
                        <asp:GridView ID="gvRecycle" runat="server" Width="100%" AutoGenerateColumns="False"
                            OnRowDataBound="gvRecycle_RowDataBound" DataKeyNames="MessageId" 
                            onrowcommand="gvRecycle_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="MessageId" SortExpression="MessageId" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("MessageId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息主题" SortExpression="MsgTitle">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTitle" runat="server" Text='<%# CutString(10,Eval("MsgTitle")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息内容" SortExpression="MsgContent">
                                    <ItemTemplate>
                                        <asp:Label ID="lblContent" runat="server" Text='<%# CutString(20,Eval("MsgContent")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="RecordTime" HeaderText="发送时间" SortExpression="RecordTime" />
                                <asp:TemplateField HeaderText="发件人" SortExpression="FromUser">
                                    <ItemTemplate>
                                        <asp:Label ID="lblFromUser" runat="server" Text='<%# Eval("FromUser.UserName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="还原">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnRecycleCancel" CommandName="recycleCancel" runat="server"
                                            ImageUrl="~/images/upcancel.gif" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="删除">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnRecycleDel" runat="server" ImageUrl="~/images/delete.gif"
                                          CommandName="recycleDel" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                          <div style="text-align:center">
                     <webdiyer:aspnetpager ID="anpRecycle" runat="server" PageSize="5"
                      ShowPageIndexBox="Always" ShowNavigationToolTip="True" PageIndexBoxType="DropDownList" 
                      PagingButtonSpacing="10px" CssClass="paginator" onpagechanged="anpRecycle_PageChanged">
                </webdiyer:aspnetpager>
                </div>
                    </div>
                    <br />
                    <asp:Button ID="btnDraft" OnClick="btnDraft_Click" runat="server" CssClass="buttonCss"
                        Width="100%" Text="草稿箱"></asp:Button>
                    <div style="width: 100%; background-color: transparent" id="div_Draft" runat="server"
                        visible="false">
                        <asp:GridView ID="gvDraft" runat="server" Width="100%" AutoGenerateColumns="False"
                            OnRowDataBound="gvDraft_RowDataBound" DataKeyNames="MessageId" 
                            onrowcommand="gvDraft_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="MessageId" SortExpression="MessageId" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("MessageId") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息主题" SortExpression="MsgTitle">
                                    <ItemTemplate>
                                        <asp:Label ID="lblTitle" runat="server" Text='<%# CutString(10,Eval("MsgTitle")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="消息内容" SortExpression="MsgContent">
                                    <ItemTemplate>
                                        <asp:Label ID="lblContent" runat="server" Text='<%# CutString(20,Eval("MsgContent")) %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="RecordTime" HeaderText="发送时间" SortExpression="RecordTime" />
                                <asp:TemplateField HeaderText="发件人" SortExpression="FromUser">
                                    <ItemTemplate>
                                        <asp:Label ID="lblFromUser" runat="server" Text='<%# Eval("FromUser.UserName") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="详细">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnDraftEdit" CommandName="draftEdit" runat="server"
                                            ImageUrl="~/images/edit.gif" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="删除">
                                    <ItemStyle Width="50px"></ItemStyle>
                                    <HeaderStyle Width="50px"></HeaderStyle>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtnDraftDel" runat="server" ImageUrl="~/images/delete.gif"
                                            CommandName="draftDel" CommandArgument='<%# Eval("MessageId") %>'></asp:ImageButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                              <div style="text-align:center">
                     <webdiyer:aspnetpager ID="anpDraft" runat="server" PageSize="5"
                      ShowPageIndexBox="Always" ShowNavigationToolTip="True" PageIndexBoxType="DropDownList" 
                      PagingButtonSpacing="10px" CssClass="paginator" onpagechanged="anpDraft_PageChanged">
                </webdiyer:aspnetpager>
                </div>
                    </div>
                </div>
            </div>
        </contenttemplate>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
